package models

import (
	"strconv"
)

type AdminUser struct {
	UserId   uint   `json:"userId" gorm:"primaryKey"`
	UserName string `json:"userName" gorm:"not null;comment:用户名"`
	PhoneNum string `json:"phoneNum" gorm:"not null comment:手机号（注册必须）"`
	Password string `json:"password" gorm:"not null comment:密码"`
	RoleId   int    `json:"roleId" gorm:"default:1; not null comment:角色id""`
	Avatar   string `json:"avatar" gorm:"not null; comment:头像"`
	Status   int    `json:"status" gorm:"not null default: 0; comment:登陆状态"`
	Timestamps
	SoftDeletes
}

func (user AdminUser) GetUid() string {
	return strconv.Itoa(int(user.UserId))
}
